package logic

import (
	"context"
	"work1/user_srv/moble/redis"

	"work1/user_srv/internal/svc"
	"work1/user_srv/user"

	"github.com/zeromicro/go-zero/core/logx"
)

type SendCodeLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewSendCodeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SendCodeLogic {
	return &SendCodeLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *SendCodeLogic) SendCode(in *user.SendCodeRequest) (*user.SendCodeResponse, error) {
	// todo: add your logic here and delete this line
	redis.SendCode(in.Username, in.Source, in.Code)
	return &user.SendCodeResponse{}, nil
}
